package com.link.database.service.impl;

import com.link.database.dao.DBZoneDao;
import com.link.database.entity.DBZone;
import com.link.database.service.DBZoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DBZoneServiceImpl implements DBZoneService {
    @Autowired
    private DBZoneDao dbZoneDao;

    @Override
    public int addZone(DBZone dbZone) {
        return dbZoneDao.insert(dbZone);
    }

    @Override
    public int deleteZone(long id) {
        return dbZoneDao.deleteById(id);
    }

    @Override
    public int updateZone(DBZone dbZone) {
        return dbZoneDao.update(dbZone);
    }

    @Override
    public DBZone getZoneById(long id) {
        return dbZoneDao.selectById(id);
    }

    @Override
    public List<DBZone> getAllZones() {
        return dbZoneDao.selectAll();
    }
    
}